package cn.itsource.remote.fallback;

import cn.itsource.remote.api.LoginApi;
import cn.itsource.remote.pojo.param.AppLoginParam;
import cn.itsource.result.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginApiFallbackFactory implements FallbackFactory<LoginApi> {

    @Override
    public LoginApi create(Throwable cause) {
        cause.printStackTrace();
        return new LoginApi() {
            @Override
            public R<Void> appLoginInit(AppLoginParam appLoginParam) {
                return R.error();
            }
        };
    }
}
